
#include <iostream>
#include <map>
using namespace std;
map<char, int> m;
int main()
{
    for (int i = 97; i <= 122; i++)
    {
        if(i<='p')m[i]=(i-1)%3+1;
        else if(i<='s')m[i]=m[i-1]+1;
        else if(i<='w')m[i]=(i-2)%3+1;
        else m[i]=m[i-1]+1;
    }
    m[' '] = 1;
    // for(auto val:m)
    //     cout<<val.first<<" "<<val.second<<endl;
    string str;
    getline(cin, str);
    int s = 0;
    for (int i = 0; i < str.length(); i++)
    {
        // cout << m[str[i]] << endl;
        s += m[str[i]];
    }
    cout << s << endl;
    return 0;
}